package demo.day09;

import java.io.IOException;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/7/27-07-27-14:16
 * @Description：demo.day09        封装
 */
public class encal_demo {
    int[] a = new int[6];
    public static void main(String[] args) {
        Student student = null;
        System.out.println(student.pubName);
        student.sayHello();
    }
}
class Student{
    //属性封装
    //private 本类才能访问
    private String name;
    private int age;
    public String pubName = "hjy";
    protected String proName = "proName";
    private String priName = "priName";
    //一般配合公有方法暴露私有属性
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public void sayHello(){
    }
}
